a_star_search

Locates the next node in graph to get to a position Uses A* search algorithm Can use any sortable value type

deprecated("Killing")
void
a_star_search
(
T
U
)

Parameters

graph

The graph of nodes

start
Type: T

Starting position to go to

goal
Type: T

The end position

came_from
Type: T[T]

The positions between start and end

cost_so_far
Type: U[T]

Sum of weights (cost) to get to goal from start

Examples

1 GridWithWeights!(XY, int) grid = diagram4();
2 
3 XY[XY] came_from;
4 int[XY] cost_so_far;
5 a_star_search(grid, XY(1, 4), XY(7, 8), came_from, cost_so_far);
6 XY[] path = reconstruct_path(came_from, XY(1, 4), XY(7, 8));
7 
8 // TODO: asserts

Meta